/*
 * Custom class creates INVENTORY data type
 */
package com.example.wmuqrreader;

import android.annotation.SuppressLint;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

public class Inventory {
	
	//private variables
	int 	_id;		//db id
	String 	_location;	//location description
	String 	_serialNum;	//serial number
	String 	_type;		//type of extinguisher. i.e: DC-10
	String 	_brand;		//manufacturer
	String 	_svDate;	//date checked/serviced
	String	_year;		//year manufactured
	int		_inv;		//inventory number (QR code)
	
	int		_building;	//building id

	//Empty constructor
	public Inventory(){
	}
	
	//Constructor
	public Inventory(int id, String loc, String sn, String type, String brand, String sd, String yr, int inv, int bldg){
		this._id = id;
		this._location = loc;
		this._serialNum = sn;
		this._type = type;
		this._brand = brand;
		this._svDate = sd;
		this._year = yr;
		this._inv = inv;
		this._building = bldg;
	}
	
	//Constructor
	public Inventory(String loc, String sn, String type, String brand, String sd, String yr, int inv, int bldg){
		this._location = loc;
		this._serialNum = sn;
		this._type = type;
		this._brand = brand;
		this._svDate = sd;
		this._year = yr;
		this._inv = inv;
		this._building = bldg;
	}
	
	//Constructor
	@SuppressLint("SimpleDateFormat")
	public Inventory(String loc){
		
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
		Date date = new Date();
		
		this._location = loc;
		this._serialNum = "000000";
		this._type = "DC-10";
		this._brand = "AMEREX";
		this._svDate = dateFormat.format(date);
		this._year = "2012";
		this._inv = 000000;
		this._building = 1;
	}
	
	//Constructor
	@SuppressLint("SimpleDateFormat")
	public Inventory(String loc, int num){
			
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd");
		Date date = new Date();
		
		this._location = loc;
		this._serialNum = "000000";
		this._type = "DC-10";
		this._brand = "AMEREX";
		this._svDate = dateFormat.format(date);
		this._year = "2012";
		this._inv = 000000;
		this._building = num;
	}
	
	//Constructor - to be used exclusively when a search returns empty 
	@SuppressLint("SimpleDateFormat")
	public Inventory(int inv){
		
		this._inv = inv;
	}


	//Getters & setters
	public int get_id() {
		return _id;
	}

	public void set_id(int _id) {
		this._id = _id;
	}

	public String get_location() {
		return _location;
	}

	public void set_location(String _location) {
		this._location = _location;
	}

	public String get_serialNum() {
		return _serialNum;
	}

	public void set_serialNum(String _serialNum) {
		this._serialNum = _serialNum;
	}

	public String get_type() {
		return _type;
	}

	public void set_type(String _type) {
		this._type = _type;
	}

	public String get_brand() {
		return _brand;
	}

	public void set_brand(String _brand) {
		this._brand = _brand;
	}

	public String get_svDate() {
		return _svDate;
	}

	public void set_svDate(String _svDate) {
		this._svDate = _svDate;
	}

	public String get_year() {
		return _year;
	}

	public void set_year(String _year) {
		this._year = _year;
	}

	public int get_inv() {
		return _inv;
	}

	public void set_inv(int _inv) {
		this._inv = _inv;
	}
	
	public int get_building() {
		return _building;
	}

	public void set_building(int _building) {
		this._building = _building;
	}
	

}
